<script setup lang="ts">
import { ref } from "vue";
import { useRouter } from "vue-router";
const list = ref([
  {
    name: "DetailInfo 列详情",
    path: "/detail/detailInfo",
  },
  {
    name: "ImageUpload 图片上传",
    path: "/image/imageUpload",
  },
  {
    name: "DetailImg 图片详情",
    path: "/detail/detailImg",
  },
  {
    name: "Date 时间",
    // path:'/form/date'
    path: "/datePicker",
  },
  {
    name: "Picker 选择器",
    path: "/form/select",
  },
  {
    name: "FormPopup 表单弹框",
    // path:'/form/modal'
    path: "/modal",
  },
  {
    name: "Detail 表单详情模板",
    path: "/detail",
  },
  {
    name: "Form 表单模板",
    path: "/form",
  },
  {
    name: "登录",
    path: "/login",
  },
  {
    name: "文本域",
    path: "/verifyForm",
  },
  {
    name: "多选组搜索",
    path: "/selectorList",
  },
  {
    name: "单多选",
    path: "/checkbox",
  },
  {
    name: "时间范围选择",
    path: "/dateRangeList",
  },
  {
    name: "详情",
    path: "/detailPage",
  },
  {
    name: "详情2",
    path: "/detailPage2",
  },
]);
const router = useRouter();
function jumpTo(path: string) {
  router.push(path);
}
</script>

<template>
  <div class="box">
    <div class="title">
      <img src="https://fastly.jsdelivr.net/npm/@vant/assets/logo.png" /><span
        >vue-mobile-hxq</span
      >
    </div>
    <div class="info">轻量、可靠的移动端组件库</div>
    <div class="info">基础组件</div>
    <ul>
      <li v-for="(item, index) in list" :key="index" @click="jumpTo(item.path)">
        <div class="name">{{ item.name }}</div>
        <div><van-icon name="arrow" color="#abadaf" size="18px" /></div>
      </li>
    </ul>
  </div>
</template>

<style lang="scss" scoped>
.box {
  padding: 46px 20px 20px;
  .title {
    margin-bottom: 16px;
    img {
      width: 32px;
      vertical-align: middle;
    }
    span {
      margin-left: 16px;
      font-size: 32px;
      vertical-align: middle;
    }
  }
  .title + .info {
    margin: 0 0 40px;
  }
  .info {
    color: #969799;
    font-size: 14px;
  }
  ul {
    height: calc(100vh - 200px);
    overflow-y: auto;
    margin-top: 8px;
    li {
      display: flex;
      margin: 0 0 12px;
      padding-left: 20px;
      padding-right: 16px;
      color: #34495e;
      font-weight: 600;
      font-size: 14px;
      line-height: 40px;
      background-color: #fff;
      border-radius: 99px;
      .name {
        flex: 1;
      }
    }
  }
}
</style>
